<template>
  <el-dialog
    title="位置信息"
    :visible.sync="centerDialogVisible"
    :close-on-click-modal=false
    :modal-append-to-body=false
    :append-to-body=false
    :destroy-on-close="true"
    width="40%"

    center>
    <div class="dialog-context">
      <ul style="margin: 0 auto;">
         <li v-for="(item,index) in cargo" :key="index" style="width: 100%">
             <span>{{type[item.state-1]}}&nbsp;</span>
             <span>{{item.warehouse.district+item.warehouse.town+item.warehouse.warehouseName}}仓库</span>
         </li>
      </ul>
    </div>
    <span slot="footer" class="dialog-footer">
    <el-button @click="closeDialog">关闭</el-button>

  </span>
  </el-dialog>
</template>

<script>
export default {
  name:'LocationDialog',
  props:['cargo'],
  data() {
    return {
      centerDialogVisible: false,
      type:['入库','出库'],
    }
  },

  mounted() {
    console.log(this.cargo)
  },

  methods:{
    open(){
      this.centerDialogVisible = true;
    },

    closeDialog(){
      this.centerDialogVisible = false;
    }
  },
}
</script>

<style scoped>
.el-dialog__wrapper{

}

.dialog-context{
  margin: 0 auto;
  width: 400px;

}
.dialog-context ul{
  list-style: none;
  color:black;
  font-size: 20px;
}
.dialog-context ul li{
  margin: 10px 40px;
}
</style>
